<%-- Created by IntelliJ IDEA. --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
  <head>
    <title></title>
  </head>
  <body>
      <h1>办公楼门禁管理系统</h1>
      <a href="add.jsp"><button>办卡</button></a>
      <form action="SelectListServlet" method="post">
          <table>
              <tr>
                  <td>用户名：<input type="text" name="userName">
                  启用状态：
                    <select name="status">
                        <option value="1">启用</option>
                        <option value="0">禁用</option>
                    </select>
                  </td>
                  <td align="center"><input type="submit" value="搜索"></td>
              </tr>
          </table>
      </form>
      <table border="1">
          <tr>
            <th>持卡人姓名</th>
            <th>持卡人身份证号</th>
            <th>启用状态</th>
            <th>办卡日期</th>
            <th>操作</th>
          </tr>
          <c:forEach items="${list}" var="s">
              <tr>
                  <td>${s.userName}</td>
                  <td>${s.idNumber}</td>
                  <td>${s.status==1?"启用":"禁用"}</td>
                  <td>${s.createDate}</td>
                  <td><a href="UpdateServlet?id=${s.id}&status=${s.status}">${s.status==1?"禁用":"启用"}</a>
                        <a href="DeleteServlet?id=${s.id}">删除</a>
                        <a href="SelectIdNumberServlet?idNumber=${s.idNumber}">详情</a>
                  </td>
              </tr>
          </c:forEach>
      </table>
        <a href="ListServlet?pageNo=1">首页</a>
            <a href="ListServlet?pageNo=${pageNo+1}">下一页</a>
            <a href="ListServlet?pageNo=${pageNo-1}">上一页</a>

  </body>
</html>